import { _decorator, Component, Node } from 'cc';
import { BaseComponent } from '../../Manager/UIManager/BaseComponent';
import { GAME_POP, GlobalData } from '../../Data/GlobalData';
import { MiddleLoad } from './MiddleLoad/MiddleLoad';
import { GunInfo } from '../../Data/GlobaInterface';
import { ClearLoad } from './ClearLoad/ClearLoad';
const { ccclass, property } = _decorator;

@ccclass('GameScene')
export class GameScene extends BaseComponent {

    //祖玛游戏层
    @property(Node)
    private ZumaLoad: Node = null;

    //炮台曾
    @property(Node)
    private MiddleLoad: Node = null;

    //消除层
    @property(Node)
    private ClearLoad: Node = null;

    protected Init(): void {
        app.logManager.info("游戏场景初始化")
    }
    protected OnShow(): void {
        this.GameStart();
    }

    //当前游戏等级
    private NowGameLevel: number = 0;

    /**
     * 游戏开始
     */
    private GameStart() {
        GlobalData.BrickTypeNum = 5;
        GlobalData.GameOver = false;
    }

    /**
     * 大炮添加炮弹
     */
    public AddBullet(_guninfo: GunInfo) {
        this.MiddleLoad.getComponent(MiddleLoad).AddBullet(_guninfo);
    }

    /**
     * 游戏过关
     */
    public PassLevel() {
        this.NowGameLevel++;
        this.GameStart();
    }


}


